<%@page import="java.sql.ResultSet"%><%@ page session="true" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
	session = request.getSession(true);
	String strId = (String)session.getAttribute("id");
	if(strId == null){
		response.sendRedirect("login.jsp");
	}
	
	String strProjectId = request.getParameter("projectId");
	if(strProjectId == null){
		response.sendRedirect("selectProject.jsp");
	}
	
	session.setAttribute("projectId", strProjectId);
%>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		
		<script type="text/javascript">
		
		</script>
		<script type="text/javascript" src='./js/util.js'></script>
		<script type="text/javascript" src='./js/imageModel.js'></script>
		<script type="text/javascript" src='./js/issueModel.js'></script>
		<script type="text/javascript">
			var selObject = null;
			
			createTempIssue = function(){
				
			}
			
			
			showContextMenu = function(oEvent){
				ele_contextMenu.setAttributeNS(null, 'style', 'display:;position:absolute;border:1px solid #CCC;background-color:#EEE;left:'+oEvent.clientX + ';top:' + oEvent.clientY +";");
			}
			
			hideContextMenu = function(){
				ele_contextMenu.setAttributeNS(null, 'style', 'display:none;');
			}
			
			click_ImageUpload = function(){
				window.open("./imageUploadPopup.jsp","","scrollbars,toolbar=no,location=no,directories=no,status=no,menubar=yes,resizable=no,width=300,height=200");
			}
			
			click_ImageInsert = function(){
				window.open("./selectImage.jsp?projectId=<%=strProjectId%>","","scrollbars,toolbar=no,location=no,directories=no,status=no,menubar=yes,resizable=no,width=540,height=500");
			}
			
			
			insertImage = function(_strImageName){
				var img = new imageModel;
				img.m_strSrc = "./getImageFile.jsp?projectId=<%=strProjectId%>&imageId=" + _strImageName;
				img.resize(100, 100, 200, 200);
				img.displayImage();
			}
			
			click_CreateIssue = function(){
				var issue = new issueModel;
				issue.move(100, 100);
				issue.displayNormalize();
			}
			
		</script>
		
	</head>
	<body id="eleBody" onselectstart="return false;" ondragstart="return false;" onclick='hideContextMenu();' oncontextmenu="showContextMenu(event);return false;" cellspacing="0" cellpadding="0" onLoad="createTempIssue();" style="cursor:point;padding:0;margin:0;" width="100%" height="100%"  >

		
		<div id="ele_contextMenu" style="position:absolute;border:1px solid #CCC;background-color:#EEE;display:none;">
			<div class="imageMenu" style="border:1px solid #CCC;background-color:#EEE;" align="center">
				
			</div>
			<div style="border:1px solid #CCC;background-color:#EEE;" align="center" >
				<img width="30px" src="./img/contextMenu/showlist.png" /><img width="30px" src="./img/contextMenu/userplus.png" /><img width="30px" src="./img/contextMenu/userdel.png" />
			</div>
			<div style="border:1px solid #CCC;background-color:#EEE;" align="center" onclick="click_ImageInsert();">
				Image Insert
			</div>
			<div style="border:1px solid #CCC;background-color:#EEE;" align="center" onclick="click_ImageUpload();" >
				Image Upload
			</div>
			<div style="border:1px solid #CCC;background-color:#EEE;" align="center" onclick="click_CreateIssue();" >
				Issue Create
			</div>
		</div>
		
		<svg style="display:block;width:100%;height:100%;" xmlns="http://www.w3.org/2000/svg" >
			<g id="eleRootGroup">
			
			</g>
		</svg>
		
	</body>
</html>
		